cmake_minimum_required(VERSION 3.0.0)
project(test VERSION 0.1.0)
set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_CXX_STANDARD 11)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(YAML_INCLUDE /usr/include/yaml-cpp)
set(YAML_LIB )
if (NOT OPENCV_FOUND)
    find_package(OpenCV  REQUIRED)
endif()

find_package(Boost REQUIRED COMPONENTS system thread)

if(NOT PCL_FOUND)
    find_package(PCL REQUIRED)
endif()

find_package(yaml-cpp REQUIRED)

include_directories(
    ${OpenCV_INCLUDE_DIRS}
    ${PCL_INCLUDE_DIRS}
    ${Boost_INCLUDE_DIRS}
    ${YAML_CPP_INCLUDE_DIR}
    # ${PROJECT_SOURCE_DIR}/driver/Dahua
    ${PROJECT_SOURCE_DIR}/driver/LCM/Communicate
    ${PROJECT_SOURCE_DIR}/driver/livox-driver/livox_lidar
    # ${PROJECT_SOURCE_DIR}/driver/ldslidar
    ${PROJECT_SOURCE_DIR}/driver/protocol
    ${PROJECT_SOURCE_DIR}/include/darknet
    # ${PROJECT_SOURCE_DIR}/src/odometry
    ${PROJECT_SOURCE_DIR}/src/Cam
    ${PROJECT_SOURCE_DIR}/src/PCLfunctions
    ./
)

add_subdirectory(driver/LCM/Communicate)
add_subdirectory(driver/livox-driver/livox_lidar)
# add_subdirectory(driver/ldslidar)
add_subdirectory(driver/protocol)
add_subdirectory(driver/Dahua)
find_library(darknet libdarknet.so /home/milo/Documents/visual/YOLO/darknet)
file(GLOB SOURCE_LIST_ODOMETRY ${PROJECT_SOURCE_DIR}/odometry/* ${PROJECT_SOURCE_DIR}/Cam/*)
# add_executable(test testtime.cpp ${PROJECT_SOURCE_DIR}/PCLfunctions/pcl_functions.cpp)
add_executable(test mains/v1.cpp 
    ${PROJECT_SOURCE_DIR}/src/PCLfunctions/LdPcl.h 
    ${PROJECT_SOURCE_DIR}/src/PCLfunctions/pcl_functions.cpp 
    ${PROJECT_SOURCE_DIR}/src/Cam/Cam.h 
    ${PROJECT_SOURCE_DIR}/src/Cam/Cam.cpp
    )
    
# add_executable(test CPPS/RegisterOdo.cpp pcl_functions.cpp LdPcl.h ${PROJECT_SOURCE_DIR}/odometry/odometry.h ${PROJECT_SOURCE_DIR}/odometry/odometry.cpp)
# add_executable(test iterative.cpp pcl_functions.cpp LdPcl.h ${PROJECT_SOURCE_DIR}/odometry/odometry.h ${PROJECT_SOURCE_DIR}/odometry/odometry.cpp)
# add_executable(test CPPS/iterative.cpp pcl_functions.cpp LdPcl.h ${SOURCE_LIST_ODOMETRY})
# add_executable(test Robust.cpp pcl_functions.cpp LdPcl.h)
# add_executable(test CPPS/play.cpp ${PROJECT_SOURCE_DIR}/PCLfunctions/pcl_functions.cpp)
# add_executable(test fusion.cpp pcl_functions.cpp LdPcl.h)
# add_executable(test CPPS/record.cpp PCLfunctions/LdPcl.h)
# add_executable(test my_Eucluster.cpp  LdPcl.h)
# add_executable(test test_EuConditional.cpp LdPcl.h)
target_link_libraries(test
    ${YAML_CPP_LIBRARIES}
    ${OpenCV_LIBS}
    ${PCL_LIBRARIES}
    ${Boost_LIBRARIES}
    ${darknet}
    # ldslidar
    livox_lidar
    protocol
    MyDahuaCam
    Communication
)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
